#ifndef COREWIDGETINTERFACE_H
#define COREWIDGETINTERFACE_H

#include "shared_global.h"

#include <QObject>
#include <QWidget>
#include <QMap>

struct tagWidgetInfo
{
    QString m_ui;
    QString m_name;
    QString m_class;
    QString m_icon;
    QString m_category;
};

class SHAREDSHARED_EXPORT QWidgetPluginInterface: public QObject
{
    Q_OBJECT
public:
    virtual QWidget* createWidget(const QString &widgetName, QWidget *parentWidget)=0;

    virtual QStringList keys()=0;

    virtual tagWidgetInfo widgetInfo(const QString &widgetName)=0;

};

#define QWidgetPluginInterface_iid "Touch.QWidgetPluginInterface"

Q_DECLARE_INTERFACE(QWidgetPluginInterface, QWidgetPluginInterface_iid)

class SHAREDSHARED_EXPORT QAbstractWidgetPlugin: public QWidgetPluginInterface
{
    Q_OBJECT
    Q_INTERFACES(QWidgetPluginInterface)
public:
    QAbstractWidgetPlugin();
    QWidget* createWidget(const QString &widgetName, QWidget *parentWidget);
    tagWidgetInfo widgetInfo(const QString &widgetName);
protected:
    QMap<QString,tagWidgetInfo> m_widgetInfos;
};

#endif
